package com.instwall.callnumserver.broadcastrecevier;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.instwall.callnumserver.service.CallNumService;

/**
 *
 * 1)配置了静态开机广播接受者模块,实现开机自起
 *
 */
public class StaticBroadcastReceiver extends BroadcastReceiver {
    private final String ACTION_BOOT = "android.intent.action.BOOT_COMPLETED";
    @Override
    public void onReceive(Context context, Intent intent) {
        if (ACTION_BOOT.equals(intent.getAction()))
            Log.d("CallNum", "[BroadcastReceiver] receive to start callnumService ");
        Intent service = new Intent(context, CallNumService.class);
        context.startService(service);
    }
}
